/**
 * 定义了一个Student类，初始化构造器函数接收三个参数：firstName, middleInitial, lastName
 * greeter函数接收person参数
 * 构建一个Student实例user，包含person所需要的参数
 */
class Student {
    public fullName: string;
    constructor(public firstName: string, public middleInitial: string, public lastName: string) {
        this.fullName = firstName + ' ' + middleInitial + ' ' + lastName;
    }
}

interface IPerson {
    firstName: string;
    lastName: string;
}

function greeter(person: IPerson) {
    return "Hello, " + person.firstName + ' ' + person.lastName;
}

let user = new Student("Jane", "M.", "User");

console.log(greeter(user))
